#include <iostream>

using namespace std;
#define int long long
const int N = 45, M = 810;
int n;
int dp[M];
signed main()
{
    cin >> n;
    int sum = (1 + n) * n / 2;
    if (sum & 1)
    {
        cout << 0 << endl;
        return 0;
    }

    sum /= 2;
    dp[0] = 1;
    for (int i = 1; i <= n; i++)
    {
        for (int j = sum; j >= i; j--)
        {
            dp[j] += dp[j - i];
        }
    }

    cout << dp[sum] / 2 << endl;
    return 0;
}